// pages/user/index/index.js
Component({
    /**
     * 组件的属性列表
     */
    properties: {
        userinfo:{
            type:Object,
            value:""
        }
    },

    /**
     * 组件的初始数据
     */
    data: {
        navlist: [{
                name: "购物车",
                id: 1,
                icon: "shopping-cart-o"
            },
            {
                name: "收藏夹",
                id: 2,
                icon: "star-o"
            },
            {
                name: "福利礼包",
                id: 3,
                icon: "gift-o"
            },
            {
                name: "客服",
                id: 4,
                icon: "service-o"
            },
            {
                name: "我的订单",
                id: 5,
                icon: "orders-o"
            },
            {
                name: "用户设置",
                id: 6,
                icon: "setting-o"
            }
        ]
    },

    /**
     * 组件的方法列表
     */
    methods: {
        goSubPages(event){
            let navid = event.currentTarget.dataset.navid
            if(navid==1){
                wx.navigateTo({
                    url: '/pages/common/shopcar/shopcar',
                })
            }else if(navid==2){
                wx.navigateTo({
                    url: '/pages/common/userfav/userfav',
                })
            }
            else if (navid == 3) {
                wx.navigateTo({
                    url: '/pages/common/gifts/gifts',
                })
            }
            else if (navid == 4) {
                wx.navigateTo({
                    url: '/pages/common/service/service',
                })
            }
            else if (navid == 5) {
                wx.navigateTo({
                    url: '/pages/common/order/order',
                })
            }
            else if (navid == 6) {
                wx.navigateTo({
                    url: '/pages/common/setting/setting',
                })
            }
        }
    }
})